package gitee.derumin.lifeissohard.mixin;

import gitee.derumin.lifeissohard.lishhungersystem.LishFoods;
import net.minecraft.item.*;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.*;

@Mixin(Items.class)
public abstract class ItemsMixin {


    @Inject(method = "register(Lnet/minecraft/util/Identifier;Lnet/minecraft/item/Item;)Lnet/minecraft/item/Item;" , at = @At(value = "RETURN"))
    private static void customs(Identifier id, Item item, CallbackInfoReturnable<Item> cir){
        item.foodComponent = LishFoods.getLishFoodComponent(id.getPath());
        if (item instanceof PotionItem || item instanceof StewItem || item instanceof SuspiciousStewItem){
            item.maxCount = 16;
        }
    }
}
